package com.jcl.recruit.core.config;

/**
 * 配置DataSource
 *
 * @author 刘明新
 * @date 2018/8/6 下午5:01
 */
//@Configuration
//@EnableTransactionManagement
//@MapperScan("com.jcl.recruit.*.mapper")
public class DataSourceConfigTest {

    /*@Bean
    @Primary
    @ConfigurationProperties(prefix="spring.datasource")
    public DruidDataSource masterDataSource() {
        DruidDataSource dataSource = new DruidDataSource();
        *//*dataSource.setRemoveAbandoned(true);
        dataSource.setRemoveAbandonedTimeout(180);
        dataSource.setLogAbandoned(true);*//*
        return dataSource;
    }

    @Bean
    public SqlSessionFactoryBean sqlSessionFactory() throws Exception {
        SqlSessionFactoryBean factory = new SqlSessionFactoryBean();
        factory.setDataSource(masterDataSource());
        factory.setConfigLocation(new ClassPathResource("/mybatis-config.xml"));
        return factory;
    }

    @Bean
    public DataSourceTransactionManager transactionManager() {
        return new DataSourceTransactionManager(masterDataSource());
    }*/

    /*@Bean
    public Filter characterEncodingFilter() {
        CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter();
        characterEncodingFilter.setEncoding("UTF-8");
        characterEncodingFilter.setForceEncoding(true);
        return characterEncodingFilter;
    }*/
}
